package com.nut.spp.enums;

import com.nut.spp.exception.ServiceException;
import lombok.Getter;

@Getter
public enum SmsEnum {

    //酒店注册验证码模板
    sendBindMobile(1, "SMS_193237725"),

    //  客户端登陆
    CLIENT_LOGIN(2, "SMS_223885054"),
    //  绑定手机号
    BIND_MOBILE(3, "SMS_193237725"),
    //  找回密码
    FIND_PASSWORD(4, "SMS_223885054"),
    //  注销帐号
    CANCEL_ACCOUNT(5, "SMS_223885054"),

    ;

    private Integer type;
    private String templateCode;

    SmsEnum(Integer type, String templateCode) {
        this.type = type;
        this.templateCode = templateCode;
    }

    public static SmsEnum getByType(Integer type) {
        for (SmsEnum smsEnum : values()) {
            if (smsEnum.getType().equals(type)) {
                return smsEnum;
            }
        }
        throw new ServiceException("短信模板不存在");
    }

    public static void main(String[] args) {

        System.out.println(SmsEnum.sendBindMobile);


    }

}
